/*
 *    Copyright (c) 2018-2025, infomng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: infomng
 */

import request from "@/router/axios";

export function fetchList(query) {
  return request({
    url: "/admin-api/o3-workorder/opltshhs4-3/page",
    method: "get",
    params: query,
  });
}

export function addObj(obj) {
  return request({
    url: "/admin-api/o3-workorder/opltshhs",
    method: "post",
    data: obj,
  });
}

export function getObj(id) {
  return request({
    url: "/admin-api/o3-workorder/opltshhs/" + id,
    method: "get",
  });
}

export function delObj(id) {
  return request({
    url: "/admin-api/o3-workorder/opltshhs/" + id,
    method: "delete",
  });
}

export function putObj(obj) {
  return request({
    url: "/admin-api/o3-workorder/opltshhs",
    method: "put",
    data: obj,
  });
}

/**
 * DR8插回损
 * @return
 */
export function ilRlDR8(docNo, total, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs4-3/ilRlDR8/" +
      docNo +
      "/" +
      total +
      "/" +
      deviceSn,
    method: "get",
  });
}

/**
 *  DR8插回损增量数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlDR8Incremental(docNo, totalSeq, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlDR8Incremental/" +
      docNo +
      "/" +
      totalSeq +
      "/" +
      deviceSn,
    method: "get",
  });
}

/**
 * GEN1.5插回损
 * @return
 */
export function ilRlGEN(docNo, total, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlGEN/" +
      docNo +
      "/" +
      total +
      "/" +
      deviceSn,
    method: "get",
  });
}

/**
 *  GEN1.5插回损增量数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlGENIncremental(docNo, totalSeq, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlGENIncremental/" +
      docNo +
      "/" +
      totalSeq +
      "/" +
      deviceSn,
    method: "get",
  });
}
/**
 * SR8插回损
 * @return
 */
export function ilRlSR8(docNo, total, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlSR8/" +
      docNo +
      "/" +
      total +
      "/" +
      deviceSn,
    method: "get",
  });
}

/**
 *  SR8插回损增量数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlSR8Incremental(docNo, totalSeq, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlSR8Incremental/" +
      docNo +
      "/" +
      totalSeq +
      "/" +
      deviceSn,
    method: "get",
  });
}
/**
 *  DR8插回损直方图数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlDR8Histogram(docNo, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs4-3/ilRlDR8Histogram/" +
      docNo +
      "/" +
      deviceSn,
    method: "get",
  });
}
/**
 *  SR8插回损直方图数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlSR8Histogram(docNo, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlSR8Histogram/" +
      docNo +
      "/" +
      deviceSn,
    method: "get",
  });
}
/**
 *  Gen1.5插回损直方图数据查询
 * @param docNo
 * @param totalSeq
 * @returns {AxiosPromise}
 */
export function ilRlGenHistogram(docNo, deviceSn) {
  return request({
    url:
      "/admin-api/o3-workorder/opltshhs/ilRlGenHistogram/" +
      docNo +
      "/" +
      deviceSn,
    method: "get",
  });
}
